<template>
  <div class="Test">
    <button @click="change">点击显示/隐藏msg</button>
    <transition-group
      name="animate__animated animate__bounce"
      appear
      enter-active-class="animate__bounce"
      leave-active-class="animate__fadeOut"
    >
      <h2 v-show="isShow" key="1">{{ msg }}</h2>
      <h2 v-show="isShow" key="2">两个同样的动画</h2>
    </transition-group>
  </div>
</template>

<script>
import "animate.css";
export default {
  name: "Test3",
  data() {
    return {
      isShow: "true",
      msg: "你好啊",
    };
  },
  methods: {
    change() {
      this.isShow = !this.isShow;
    },
  },
  components: {},
};
</script>

<style scoped>
.Test {
  margin: 0 auto;
}
h2 {
  margin: 0 auto;
  width: 300px;
  background-color: orange;
}
</style>
